package com.banch.cloud.feign.controller;

import com.banch.cloud.common.entity.Payment;
import com.banch.cloud.common.vo.CommonResult;
import com.banch.cloud.feign.service.PaymentFeignService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 订单-控制层
 *
 * @author banch
 * @version 1.0
 * @date 2020/7/9
 */
@RequestMapping(value = {"/consumer/order"})
@Controller
public class OrderOpenFeignController {

    /**
     * paymentFeignService
     */
    @Resource
    private PaymentFeignService paymentFeignService;

    @ResponseBody
    @GetMapping(value = {"/get/{id}"})
    public CommonResult<Payment> getById(@PathVariable("id") Long id) {
        return paymentFeignService.getById(id);
    }

    @ResponseBody
    @PostMapping(value = "/timeout")
    String paymentTimeout(String ppp) {

        return paymentFeignService.paymentTimeout(ppp);
    }

}